package com.webchat.rmi.search;

import com.webchat.common.bean.APIPageResponseBean;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "webchat-search-service",
        contextId = "searchEngineClient",
        configuration = RpcRequestInterceptor.class)
public interface SearchEngineClient {

    @GetMapping("/search-service/content/query")
    APIPageResponseBean query(@RequestParam(value = "q", required = false) String query,
                              @RequestParam(value = "type", required = false) Integer type,
                              @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
                              @RequestParam(value = "size", required = false, defaultValue = "10") Integer size);
}